/*********************************************************************
	\file :           os_sw_layers\bios\services\scheduler\Os_Types.h
	\brief:           Provide the required data definitions for Task Management services support.
	\author:          Manuel Sandoval
	\version:         1.0
	\date:            Sat, 01, March 2014
*********************************************************************/

#ifndef Os_Types_H
#define Os_Types_H

/******************************* Includes**********************************/

#include "typedef_OS.h"
#include "Mcu.h"


/******************************* Typedef ******************************/

typedef u16 TaskType;							/*!< Identifies a task, commonly associated with the TaskID. */
typedef u8 TaskStateType;						/*!< Reference to a variable of type TaskType. */

typedef TaskType* TaskRefType;					/*!< Identifies a task state. */
typedef TaskStateType* TaskStateRefType;		/*!< Reference to a variable of type TaskStateType */


/******************************* Defines **********************************/

#ifndef TASK
#define TASK(taskID) void taskID(void)
#endif


#define DeclareTask(taskID) extern TASK(taskID)


#ifndef STATUSTYPEDEFINED
#define STATUSTYPEDEFINED
typedef unsigned char StatusType;  /* THIS MUST BE "unsigned char" */
#define E_OK           ((StatusType)0)
#endif /* STATUSTYPEDEFINED */

#define E_OS_ACCESS    ((StatusType)1)
#define E_OS_CALLEVEL  ((StatusType)2)
#define E_OS_ID        ((StatusType)3)
#define E_OS_LIMIT     ((StatusType)4)
#define E_OS_NOFUNC    ((StatusType)5)
#define E_OS_RESOURCE  ((StatusType)6)
#define E_OS_STATE     ((StatusType)7)
#define E_OS_VALUE     ((StatusType)8)




/******************************* Enumerations******************************/


/* Task Scheduler Tasks IDs definitions */
typedef enum Os_TaskIDType
{

    TASKS_1_MS = 0,
    TASKS_4_MS,
    TASKS_8_MS,
    TASKS_16_MS,
    TASKS_32_MS,
    TASKS_64_MS,
    NONE,
    TASK_MAX_NUM = NONE,
}Os_TaskIDType;


/* Task Scheduler Tasks IDs definitions */
typedef enum Os_TaskStateType
{
    SUSPENDED = 0,
    READY,
    RUNNING,
}Os_TaskStateType;


/******************************* Structures *******************************/


/******************************* Global Variables **********************************/

/******************************* Functions ********************************/


/** @} *//* End of Scheduler Types Group */

#endif /* Os_Types_H */

/*********************************************************************
	File	: os_sw_layers\bios\mcu\Mcu_Cfg.h 
*********************************************************************/
